package com.msb.singleton;

/**
 * @Auther： WangLei
 * @Date： 2021/8/1-08-01-22:17
 * @Description: com.msb.singleton.Base 基础单例模式
 * @version: 1.0
 */
public class Base {
    private Base(){}
    private static final Base INSTANCE = new Base();

    public static Base getInstance(){
        return INSTANCE;
    }

    public static void main(String[] args) {
        Base b1 = Base.getInstance();
        Base b2 = Base.getInstance();

        System.out.println(b1 == b2);
    }

}

/*
//单例不能被继承
class extendsBase extends Base {

}*/
